Carbon


DMSetMainDisplay

Header: Displays.h Carbon status: Supported

Sets a display to be the main screen. You should generally never need to use this function.

OSErr DMSetMainDisplay (
    GDHandle newMainDevice, 
    Handle displayState
);
Parameter descriptions
newMainDevice

A handle to the GDevice structure for the video device whose display you wish to make the main screen.

displayState

If your application called DMBeginConfigureDisplays, you must pass the displayState handle obtained. Otherwise pass NULL in this parameter.

function result

A result code.

DISCUSSION

After a call to the function DMSetMainDisplay, the handle specified by the parameter newMainDevice will point to the GDevice structure for the video device whose display, before calling DMSetMainDisplay, was the main screen. To obtain a handle to the main screen, you can use the Color QuickDraw function GetMainDevice.

DMSetMainDisplay moves the menu bar to the display for the video device specified by newMainDevice. QuickDraw maps the (0,0) origin point of the global coordinate system to the main screen’s upper-left corner, and other screens are positioned adjacent to it.

SPECIAL CONSIDERATIONS

Because this function may move or purge memory blocks or access handles, you cannot call it at interrupt time.

Applications generally never need to use this function. In case you find a compelling need to change the user’s display configuration, this function is described here for completeness. Note that if your application uses Display Manager functions to change the display configuration of the user’s video devices, your application should make these changes only with the consent of the user. If your application must have a specific pixel depth, for example, it should display a dialog box that offers the user a choice between changing to that depth or canceling display of the image.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)